NcApi
Macros | Typedefs | Enumerations | Functions
NeoParser.h File Reference
#include <stdint.h>
#include "NcApi.h"
Include dependency graph for NeoParser.h:

Macros

#define NCAPI_HOST_PREFIX_SIZE   2
 
#define NCAPI_HOSTACK_LENGTH   2
 
#define NCAPI_HOSTDATA_HEADER_SIZE   5
 
#define NCAPI_HOSTDATA_MIN_LENGTH   (NCAPI_HOSTDATA_HEADER_SIZE+NCAPI_HOST_PREFIX_SIZE)
 
#define NCAPI_HOSTDATAHAPA_HEADER_SIZE   7
 
#define NCAPI_HOSTDATAHAPA_MIN_LENGTH   (NCAPI_HOSTDATAHAPA_HEADER_SIZE+NCAPI_HOST_PREFIX_SIZE)
 
#define NCAPI_WESREQUEST_LENGTH   6
 
#define NCAPI_WESRESPONSE_LENGTH   7
 
#define NCAPI_WESCMD_LENGTH   1
 
#define NCAPI_WESSTATUS_LENGTH   1
 
#define NCAPI_NODEINFOREPLY_LENGTH   8
 

Typedefs

typedef enum NcApiMessageType NcApiMessageType
 

Enumerations

enum  NcApiMessageType {
  CommandAcknowledgedEnum = 0x03, WesCmdEnum = 0x10, WesRequestEnum = 0x61, WesResponseEnum = 0x11,
  WesStatusEnum = 0x60, HostAckEnum = 0x50, HostNAckEnum = 0x51, HostDataEnum = 0x52,
  HostDataHapaEnum = 0x53, NodeInfoReplyEnum = 0x58
}
 

Functions

int NcApiIsValidApiFrame (uint8_t *buffer, uint16_t position, uint16_t *outStartAt, uint16_t *outLength)
 Determines if the content in the buffer is a valid Api-message. More...
 
int NcApiIsValidSysFrame (uint8_t *buffer, uint16_t position, uint16_t *outStartAt, uint16_t *outLength)
 Determines if the content in the buffer is a valid System-trace-message or a Bootloader-message. More...
 
int NcApiIsMsgNodeIdUid (uint8_t *buffer, uint16_t startAt, uint16_t length)
 Determines whether the message in the buffer contains NodeId and Uid. More...
 
void NcApiGetMsgAsHostAck (uint8_t *buffer, tNcApiHostAck *p)
 Deserializes the content of the bufer into a tNcApiHostAck instance. More...
 
void NcApiGetMsgAsHostData (uint8_t *buffer, tNcApiHostData *p)
 Deserializes the content of the bufer into a tNcApiHostData instance. More...
 
void NcApiGetMsgAsHostDataHapa (uint8_t *buffer, tNcApiHostDataHapa *p)
 Deserializes the content of the bufer into a tNcApiHostDataHapa instance. More...
 
void NcApiGetMsgAsWesStatus (uint8_t *buffer, tNcApiWesStatus *p)
 Deserializes the content of the bufer into a tNcApiWesStatus instance. More...
 
void NcApiGetMsgAsWesRequest (uint8_t *buffer, tNcApiWesRequest *p)
 Deserializes the content of the bufer into a tNcApiWesRequest instance. More...
 

Macro Definition Documentation

#define NCAPI_HOST_PREFIX_SIZE   2
#define NCAPI_HOSTACK_LENGTH   2
#define NCAPI_HOSTDATA_HEADER_SIZE   5
#define NCAPI_HOSTDATA_MIN_LENGTH   (NCAPI_HOSTDATA_HEADER_SIZE+NCAPI_HOST_PREFIX_SIZE)
#define NCAPI_HOSTDATAHAPA_HEADER_SIZE   7
#define NCAPI_HOSTDATAHAPA_MIN_LENGTH   (NCAPI_HOSTDATAHAPA_HEADER_SIZE+NCAPI_HOST_PREFIX_SIZE)
#define NCAPI_NODEINFOREPLY_LENGTH   8
#define NCAPI_WESCMD_LENGTH   1
#define NCAPI_WESREQUEST_LENGTH   6
#define NCAPI_WESRESPONSE_LENGTH   7
#define NCAPI_WESSTATUS_LENGTH   1

Typedef Documentation

Enumeration Type Documentation

Enumerator
CommandAcknowledgedEnum 
WesCmdEnum 
WesRequestEnum 
WesResponseEnum 
WesStatusEnum 
HostAckEnum 
HostNAckEnum 
HostDataEnum 
HostDataHapaEnum 
NodeInfoReplyEnum 

Function Documentation

void NcApiGetMsgAsHostAck ( uint8_t *  buffer,
tNcApiHostAck p 
)

Deserializes the content of the bufer into a tNcApiHostAck instance.

Parameters
bufferBuffer containing message
pInstance to deserialize into
void NcApiGetMsgAsHostData ( uint8_t *  buffer,
tNcApiHostData p 
)

Deserializes the content of the bufer into a tNcApiHostData instance.

Parameters
bufferBuffer containing message
pInstance to deserialize into
void NcApiGetMsgAsHostDataHapa ( uint8_t *  buffer,
tNcApiHostDataHapa p 
)

Deserializes the content of the bufer into a tNcApiHostDataHapa instance.

Parameters
bufferBuffer containing message
pInstance to deserialize into
void NcApiGetMsgAsWesRequest ( uint8_t *  buffer,
tNcApiWesRequest p 
)

Deserializes the content of the bufer into a tNcApiWesRequest instance.

Parameters
bufferBuffer containing message
pInstance to deserialize into
void NcApiGetMsgAsWesStatus ( uint8_t *  buffer,
tNcApiWesStatus p 
)

Deserializes the content of the bufer into a tNcApiWesStatus instance.

Parameters
bufferBuffer containing message
pInstance to deserialize into
int NcApiIsMsgNodeIdUid ( uint8_t *  buffer,
uint16_t  startAt,
uint16_t  length 
)

Determines whether the message in the buffer contains NodeId and Uid.

Parameters
bufferBuffer containing message
startAtIndex of message start in buffer
lengthMessage length
Returns
1==true 0==false
int NcApiIsValidApiFrame ( uint8_t *  buffer,
uint16_t  position,
uint16_t *  outStartAt,
uint16_t *  outLength 
)

Determines if the content in the buffer is a valid Api-message.

Parameters
bufferReceived RX-data
positionNumber of received bytes
[out]outStartAtIf a message was found, index into buffer where the message begins
[out]outLengthIf a message was found, the message length
Returns
1==true 0==false
int NcApiIsValidSysFrame ( uint8_t *  buffer,
uint16_t  position,
uint16_t *  outStartAt,
uint16_t *  outLength 
)

Determines if the content in the buffer is a valid System-trace-message or a Bootloader-message.

Parameters
bufferReceived RX-data
positionNumber of received bytes
[out]outStartAtIf a message was found, index into buffer where the message begins
[out]outLengthIf a message was found, the message length
Returns
1==true 0==false